home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / dev / c / libiconv_src.lha / NOTES < prev    next >
Encoding:
Text File  |  2000-11-07  |  16.3 KB  |  381 lines

  1. Q: Why does libiconv support encoding XXX? Why does libiconv not support
  2.    encoding ZZZ?
  3.  
  4. A: libiconv, as an internationalization library, supports those character
  5.    sets and encodings which are in wide-spread use in at least one territory
  6.    of the world.
  7.  
  8.    Hint1: On http://www.w3c.org/ you find a page "Languages, countries, and
  9.    the charsets typically used for them" (with a minor mistake about Albanian).
  10.    From this table, we can conclude that the following are in active use:
  11.  
  12.      ISO-8859-1, CP1252   Afrikaans, Albanian, Basque, Catalan, Danish, Dutch,
  13.                           English, Faroese, Finnish, French, Galician, German,
  14.                           Icelandic, Irish, Italian, Norwegian, Portuguese,
  15.                           Scottish, Spanish, Swedish
  16.      ISO-8859-2           Croatian, Czech, Hungarian, Polish, Romanian, Slovak,
  17.                           Slovenian
  18.      ISO-8859-3           Esperanto, Maltese
  19.      ISO-8859-5           Bulgarian, Byelorussian, Macedonian, Russian,
  20.                           Serbian, Ukrainian
  21.      ISO-8859-6           Arabic
  22.      ISO-8859-7           Greek
  23.      ISO-8859-8           Hebrew
  24.      ISO-8859-9, CP1254   Turkish
  25.      ISO-8859-10          Estonian, Inuit, Lapp, Latvian, Lithuanian
  26.      KOI8-R               Russian
  27.      SHIFT_JIS            Japanese
  28.      ISO-2022-JP          Japanese
  29.      EUC-JP               Japanese
  30.  
  31.    Ordered by frequency on the web (1997):
  32.      ISO-8859-1, CP1252   96%
  33.      SHIFT_JIS             1.6%
  34.      ISO-2022-JP           1.2%
  35.      EUC-JP                0.4%
  36.      CP1250                0.3%
  37.      CP1251                0.2%
  38.      CP850                 0.1%
  39.      MACINTOSH             0.1%
  40.      ISO-8859-5            0.1%
  41.      ISO-8859-2            0.0%
  42.  
  43.    Hint2: The character sets mentioned in the XFree86 4.0 locale.alias file.
  44.  
  45.      ISO-8859-1           Afrikaans, Basque, Breton, Catalan, Danish, Dutch,
  46.                           English, Estonian, Faroese, Finnish, French,
  47.                           Galician, German, Greenlandic, Icelandic,
  48.                           Indonesian, Irish, Italian, Lithuanian, Norwegian,
  49.                           Occitan, Portuguese, Scottish, Spanish, Swedish,
  50.                           Walloon, Welsh
  51.      ISO-8859-2           Albanian, Croatian, Czech, Hungarian, Polish,
  52.                           Romanian, Serbian, Slovak, Slovenian
  53.      ISO-8859-3           Esperanto
  54.      ISO-8859-4           Estonian, Latvian, Lithuanian
  55.      ISO-8859-5           Bulgarian, Byelorussian, Macedonian, Russian,
  56.                           Serbian, Ukrainian
  57.      ISO-8859-6           Arabic
  58.      ISO-8859-7           Greek
  59.      ISO-8859-8           Hebrew
  60.      ISO-8859-9           Turkish
  61.      ISO-8859-14          Breton, Irish, Scottish, Welsh
  62.      ISO-8859-15          Basque, Breton, Catalan, Danish, Dutch, Estonian,
  63.                           Faroese, Finnish, French, Galician, German,
  64.                           Greenlandic, Icelandic, Irish, Italian, Lithuanian,
  65.                           Norwegian, Occitan, Portuguese, Scottish, Spanish,
  66.                           Swedish, Walloon, Welsh
  67.      KOI8-R               Russian
  68.      KOI8-U               Russian, Ukrainian
  69.      EUC-JP (alias eucJP)      Japanese
  70.      ISO-2022-JP (alias JIS7)  Japanese
  71.      SHIFT_JIS (alias SJIS)    Japanese
  72.      U90                       Japanese
  73.      S90                       Japanese
  74.      EUC-CN (alias eucCN)      Chinese
  75.      EUC-TW (alias eucTW)      Chinese
  76.      BIG5                      Chinese
  77.      EUC-KR (alias eucKR)      Korean
  78.      ARMSCII-8                 Armenian
  79.      GEORGIAN-ACADEMY          Georgian
  80.      GEORGIAN-PS               Georgian
  81.      TIS-620 (alias TACTIS)    Thai
  82.      MULELAO-1                 Laothian
  83.      IBM-CP1133                Laothian
  84.      VISCII                    Vietnamese
  85.      TCVN                      Vietnamese
  86.      NUNACOM-8                 Inuktitut
  87.  
  88.    Hint3: The character sets supported by Netscape Communicator 4.
  89.  
  90.      Where is this documented? For the complete picture, I had to use
  91.      "strings netscape" and then a lot of guesswork. For a quick take,
  92.      look at the "View - Character set" menu of Netscape Communicator 4.6:
  93.  
  94.      ISO-8859-{1,2,5,7,9,15}
  95.      WINDOWS-{1250,1251,1253}
  96.      KOI8-R               Cyrillic
  97.      CP866                Cyrillic
  98.      Autodetect           Japanese  (EUC-JP, ISO-2022-JP, ISO-2022-JP-2, SJIS)
  99.      EUC-JP               Japanese
  100.      SHIFT_JIS            Japanese
  101.      GB2312               Chinese
  102.      BIG5                 Chinese
  103.      EUC-TW               Chinese
  104.      Autodetect           Korean    (EUC-KR, ISO-2022-KR, but not JOHAB)
  105.  
  106.      UTF-8
  107.      UTF-7
  108.  
  109.    Hint4: The character sets supported by Microsoft Internet Explorer 4.
  110.  
  111.      ISO-8859-{1,2,3,4,5,6,7,8,9}
  112.      WINDOWS-{1250,1251,1252,1253,1254,1255,1256,1257}
  113.      KOI8-R               Cyrillic
  114.      KOI8-RU              Ukrainian
  115.      ASMO-708             Arabic
  116.      EUC-JP               Japanese
  117.      ISO-2022-JP          Japanese
  118.      SHIFT_JIS            Japanese
  119.      GB2312               Chinese
  120.      HZ-GB-2312           Chinese
  121.      BIG5                 Chinese
  122.      EUC-KR               Korean
  123.      ISO-2022-KR          Korean
  124.      WINDOWS-874          Thai
  125.      WINDOWS-1258         Vietnamese
  126.  
  127.      UTF-8
  128.      UTF-7
  129.      UNICODE             actually UNICODE-LITTLE
  130.      UNICODEFEFF         actually UNICODE-BIG
  131.  
  132.      and various DOS character sets: DOS-720, DOS-862, IBM852, CP866.
  133.  
  134.    We take the union of all these four sets. The result is:
  135.  
  136.    European and Semitic languages
  137.      * ASCII.
  138.        We implement this because it is occasionally useful to know or to
  139.        check whether some text is entirely ASCII (i.e. if the conversion
  140.        ISO-8859-x -> UTF-8 is trivial).
  141.      * ISO-8859-{1,2,3,4,5,6,7,8,9,10}
  142.        We implement this because they are widely used. Except ISO-8859-4
  143.        which appears to have been superseded by ISO-8859-13 in the baltic
  144.        countries. But it's an ISO standard anyway.
  145.      * ISO-8859-13
  146.        We implement this because it's a standard in Lithuania and Latvia.
  147.      * ISO-8859-14
  148.        We implement this because it's an ISO standard.
  149.      * ISO-8859-15
  150.        We implement this because it's increasingly used in Europe, because
  151.        of the Euro symbol.
  152.      * ISO-8859-16
  153.        We implement this because it's an ISO standard.
  154.      * KOI8-R, KOI8-U
  155.        We implement this because it appears to be the predominant encoding
  156.        on Unix in Russia and Ukraine, respectively.
  157.      * KOI8-RU
  158.        We implement this because MSIE4 supports it.
  159.      * CP{1250,1251,1252,1253,1254,1255,1256,1257}
  160.        We implement these because they are the predominant Windows encodings
  161.        in Europe.
  162.      * CP850
  163.        We implement this because it is mentioned as occurring in the web
  164.        in the aforementioned statistics.
  165.      * CP866
  166.        We implement this because Netscape Communicator does.
  167.      * Mac{Roman,CentralEurope,Croatian,Romania,Cyrillic,Greek,Turkish} and
  168.        Mac{Hebrew,Arabic}
  169.        We implement these because the Sun JDK does, and because Mac users
  170.        don't deserve to be punished.
  171.      * Macintosh
  172.        We implement this because it is mentioned as occurring in the web
  173.        in the aforementioned statistics.
  174.    Japanese
  175.      * EUC-JP, SHIFT-JIS, ISO-2022-JP
  176.        We implement these because they are widely used. EUC-JP and SHIFT-JIS
  177.        are more used for files, whereas ISO-2022-JP is recommended for email.
  178.      * CP932
  179.        We implement this because it is the Microsoft variant of SHIFT-JIS,
  180.        used on Windows.
  181.      * ISO-2022-JP-2
  182.        We implement this because it's the common way to represent mails which
  183.        make use of JIS X 0212 characters.
  184.      * ISO-2022-JP-1
  185.        We implement this because it's in the RFCs, but I don't think it is
  186.        really used.
  187.      * U90, S90
  188.        We DON'T implement this because I have no informations about what it
  189.        is or who uses it.
  190.    Simplified Chinese
  191.      * EUC-CN = GB2312
  192.        We implement this because it is the widely used representation
  193.        of simplified Chinese.
  194.      * GBK
  195.        We implement this because it appears to be used on Solaris and Windows.
  196.      * GB18030
  197.        We implement this because it is an official requirement in the
  198.        People's Republic of China.
  199.      * ISO-2022-CN
  200.        We implement this because it is in the RFCs, but I have no idea
  201.        whether it is really used.
  202.      * ISO-2022-CN-EXT
  203.        We implement this because it's in the RFCs, but I don't think it is
  204.        really used.
  205.      * HZ = HZ-GB-2312
  206.        We implement this because the RFCs recommend it for Usenet postings,
  207.        and because MSIE4 supports it.
  208.    Traditional Chinese
  209.      * EUC-TW
  210.        We implement it because it appears to be used on Unix.
  211.      * BIG5
  212.        We implement it because it is the de-facto standard for traditional
  213.        Chinese.
  214.      * CP950
  215.        We implement this because it is the Microsoft variant of BIG5, used
  216.        on Windows.
  217.      * BIG5+
  218.        We DON'T implement this because it doesn't appear to be in wide use.
  219.        Only the CWEX fonts use this encoding. Furthermore, the conversion
  220.        tables in the big5p package are not coherent: If you convert directly,
  221.        you get different results than when you convert via GBK.
  222.      * BIG5HKSCS
  223.        We implement it because it is the de-facto standard for traditional
  224.        Chinese in Hongkong.
  225.    Korean
  226.      * EUC-KR
  227.        We implement these because they appear to be the widely used
  228.        representations for Korean.
  229.      * CP949
  230.        We implement this because it is the Microsoft variant of EUC-KR, used
  231.        on Windows.
  232.      * ISO-2022-KR
  233.        We implement it because it is in the RFCs and because MSIE4 supports
  234.        it, but I have no idea whether it's really used.
  235.      * JOHAB
  236.        We DON'T implement and document this because the Korean FAQ
  237.        (http://pantheon.yale.edu/~jshin/faq) says the Johab encoding is not
  238.        used nowadays. The code is in libiconv only for the sake of reference.
  239.      * ISO-646-KR
  240.        We DON'T implement this because although an old ASCII variant, its
  241.        glyph for 0x7E is not clear: RFC 1345 and unicode.org's JOHAB.TXT
  242.        say it's a tilde, but Ken Lunde's "CJKV information processing" says
  243.        it's an overline. And it is not ISO-IR registered.
  244.    Armenian
  245.      * ARMSCII-8
  246.        We implement it because XFree86 supports it.
  247.    Georgian
  248.      * Georgian-Academy, Georgian-PS
  249.        We implement these because they appear to be both used for Georgian;
  250.        Xfree86 supports them.
  251.    Thai
  252.      * TIS-620
  253.        We implement this because it seems to be standard for Thai.
  254.      * CP874
  255.        We implement this because MSIE4 supports it.
  256.      * MacThai
  257.        We implement this because the Sun JDK does, and because Mac users
  258.        don't deserve to be punished.
  259.    Laotian
  260.      * MuleLao-1, CP1133
  261.        We implement these because XFree86 supports them. I have no idea which
  262.        one is used more widely.
  263.    Vietnamese
  264.      * VISCII, TCVN
  265.        We implement these because XFree86 supports them.
  266.      * CP1258
  267.        We implement this because MSIE4 supports it.
  268.    Other languages
  269.      * NUNACOM-8 (Inuktitut)
  270.        We DON'T implement this because it isn't part of Unicode yet, and
  271.        therefore doesn't convert to anything except itself.
  272.    Platform specifics
  273.      * HP-ROMAN8, NEXTSTEP
  274.        We implement these because they were the native character set on HPs
  275.        and NeXTs for a long time, and libiconv is intended to be usable on
  276.        these old machines.
  277.    Full Unicode
  278.      * UTF-8, UCS-2, UCS-4
  279.        We implement these. Obviously.
  280.      * UCS-2BE, UCS-2LE, UCS-4BE, UCS-4LE
  281.        We implement these because they are the preferred internal
  282.        representation of strings in Unicode aware applications. These are
  283.        non-ambiguous names, known to glibc. (glibc doesn't have
  284.        UCS-2-INTERNAL and UCS-4-INTERNAL.)
  285.      * UTF-16, UTF-16BE, UTF-16LE
  286.        We implement these, because UTF-16 is still the favourite encoding of
  287.        the president of the Unicode Consortium (for political reasons), and
  288.        because they appear in RFC 2781.
  289.      * UTF-7
  290.        We implement this because it is essential functionality for mail
  291.        applications.
  292.      * JAVA
  293.        We implement it because it's used for Java programs and because it's
  294.        a nice encoding for debugging.
  295.      * UNICODE (big endian), UNICODEFEFF (little endian)
  296.        We DON'T implement these because they are stupid and not standardized.
  297.    Full Unicode, in terms of `uint16_t' or `uint32_t'
  298.    (with machine dependent endianness and alignment)
  299.      * UCS-2-INTERNAL, UCS-4-INTERNAL
  300.        We implement these because they are the preferred internal
  301.        representation of strings in Unicode aware applications.
  302.  
  303. Q: Support encodings mentioned in RFC 1345 ?
  304. A: No, they are not in use any more. Supporting ISO-646 variants is pointless
  305.    since ISO-8859-* have been adopted.
  306.  
  307. Q: Support EBCDIC ?
  308. A: No!
  309.  
  310. Q: How do I add a new character set?
  311. A: 1. Explain the "why" in this file, above.
  312.    2. You need to have a conversion table from/to Unicode. Transform it into
  313.    the format used by the mapping tables found on ftp.unicode.org: each line
  314.    contains the character code, in hex, with 0x prefix, then whitespace,
  315.    then the Unicode code point, in hex, 4 hex digits, with 0x prefix. '#'
  316.    counts as a comment delimiter until end of line.
  317.    Please also send your table to Mark Leisher <mleisher@crl.nmsu.edu> so he
  318.    can include it in his collection.
  319.    3. If it's an 8-bit character set, use the '8bit_tab_to_h' program in the
  320.    tools directory to generate the C code for the conversion. You may tweak
  321.    the resulting C code if you are satisfied with its quality, but this is
  322.    rarely needed.
  323.    If it's a two-dimensional character set (with rows and columns), use the
  324.    'cjk_tab_to_h' program in the tools directory to generate the C code for
  325.    the conversion. You will need to modify the main() function to recognize
  326.    the new character set name, with the proper dimensions, but that shouldn't
  327.    be too hard. This yields the CCS. The CES you have to write by hand.
  328.    4. Store the resulting C code file in the src directory. Add a #include
  329.    directive to converters.h, and add an entry to the encodings.def file.
  330.    5. Compile the package, and test your new encoding using a program like
  331.    iconv(1) or clisp(1).
  332.    6. Augment the testsuite: Add a line to each of tests/Makefile.in,
  333.    tests/Makefile.msvc and tests/Makefile.os2. For a stateless encoding,
  334.    create the complete table as a TXT file. For a stateful encoding,
  335.    provide a text snippet encoded using your new encoding and its UTF-8
  336.    equivalent.
  337.    7. Update the README and man/iconv_open.3, to mention the new encoding.
  338.    Add a note in the NEWS file.
  339.  
  340. Q: What about bidirectional text? Should it be tagged or reversed when
  341.    converting from ISO-8859-8 or ISO-8859-6 to Unicode? Qt appears to do
  342.    this, see qt-2.0.1/src/tools/qrtlcodec.cpp.
  343. A: After reading RFC 1556: I don't think so. Support for ISO-8859-8-I and
  344.    ISO-8859-E remains to be implemented.
  345.    On the other hand, a page on www.w3c.org says that ISO-8859-8 in *email*
  346.    is visually encoded, ISO-8859-8 in *HTML* is logically encoded, i.e.
  347.    the same as ISO-8859-8-I. I'm confused.
  348.  
  349. Other character sets not implemented:
  350. "MNEMONIC" = "csMnemonic"
  351. "MNEM" = "csMnem"
  352. "ISO-10646-UCS-Basic" = "csUnicodeASCII"
  353. "ISO-10646-Unicode-Latin1" = "csUnicodeLatin1" = "ISO-10646"
  354. "ISO-10646-J-1"
  355. "UNICODE-1-1" = "csUnicode11"
  356. "csWindows31Latin5"
  357.  
  358. Other aliases not implemented (and not implemented in glibc-2.1 either):
  359.   From MSIE4:
  360.     ISO-8859-1: alias ISO8859-1
  361.     ISO-8859-2: alias ISO8859-2
  362.     KSC_5601: alias KS_C_5601
  363.     UTF-8: aliases UNICODE-1-1-UTF-8 UNICODE-2-0-UTF-8
  364.  
  365.  
  366. Q: How can I integrate libiconv into my package?
  367. A: Just copy the entire libiconv package into a subdirectory of your package.
  368.    At configuration time, call libiconv's configure script with the
  369.    appropriate --srcdir option and maybe --enable-static or --disable-shared.
  370.    Then "cd libiconv && make && make install-lib libdir=... includedir=...".
  371.    'install-lib' is a special (not GNU standardized) target which installs
  372.    only the include file - in $(includedir) - and the library - in $(libdir) -
  373.    and does not use other directory variables. After "installing" libiconv
  374.    in your package's build directory, building of your package can proceed.
  375.  
  376. Q: Why is the testsuite so big?
  377. A: Because some of the tests are very comprehensive.
  378.    If you don't feel like using the testsuite, you can simply remove the
  379.    tests/ directory.
  380.  
  381.